package com.zijie.shopviewapi.view.service.impl;

import com.zijie.shopviewapi.view.dao.ViewMapper;
import com.zijie.view.service.ViewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class ViewServiceImpl implements ViewService {
    private ViewMapper viewMapper;

    @Autowired
    public void setViewMapper(ViewMapper viewMapper) {
        this.viewMapper = viewMapper;
    }

    @Override
    public Long countOrders() {
        return viewMapper.countOrders();
    }

    @Override
    public Long countMembers() {
        return viewMapper.countMembers();
    }

    @Override
    public Double countPrices() {
        return viewMapper.countPrices();
    }

    @Override
    public List<Map<String, Object>> hotItems() {
        return viewMapper.hotItems();
    }

    @Override
    public List<Map<String, Object>> orderCountGroupByDate(Date startDate, Date endDate) {
        return viewMapper.orderCountGroupByDate(startDate, endDate);
    }

    @Override
    public List<Map<String, Object>> priceCountGroupByDate(Date startDate, Date endDate) {
        return viewMapper.priceCountGroupByDate(startDate, endDate);
    }

}
